package com.lastoffer2.listener;

import com.lastoffer2.activity.DetailOfferActivity;
import com.lastoffer2.activity.InsertOfferActivity;
import com.lastoffer2.activity.ListOfferActivity;
import com.lastoffer2.activity.ListOfferSuperUserActivity;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;

public class OnItemClickListenerMainMenu implements OnItemClickListener {

	private Context context;

	public OnItemClickListenerMainMenu(Context context) {
		this.context = context;
	}

	/**
	 * <item>Ristoranti</item> <item>Aperitivi</item> <item>Offerte</item>
	 * <item>Le tue prenotazioni</item> <item>Crea offerta</item> <item>Le tue
	 * offerte</item> <item>Strumenti</item>
	 */
	@Override
	public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
		Intent intent = null;
		switch (arg2) {
		case 0://Ristoranti
			intent = new Intent(context, ListOfferActivity.class);
			break;
		case 1://Aperitivi
			intent = new Intent(context, ListOfferActivity.class);
			break;
		case 2://Offerte
			intent = new Intent(context, ListOfferActivity.class);
			break;
		case 3://Le tue prenotazioni
			intent = new Intent(context, ListOfferActivity.class);
			break;
		case 4: //Crea offerta
			intent = new Intent(context, InsertOfferActivity.class);			
			intent.putExtra("IdUser", 1);
			break;
		case 5://Le tue offerte
			intent = new Intent(context, ListOfferSuperUserActivity.class);
			intent.putExtra("IdUser", 1);
			break;

		default:
			intent = new Intent(context, ListOfferActivity.class);
			break;
		}

		context.startActivity(intent);

	}

}
